/*
 * @Author: hanmengjie 515044692@qq.com
 * @Date: 2022-06-13 11:02:37
 * @LastEditors: hanmengjie 515044692@qq.com
 * @LastEditTime: 2022-06-17 14:41:44
 * @FilePath: \doctor_end\src\service\doctorServuce.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import api from "@/api";
import axios from "@/utils/axios";


export default {
    getDoctorList,
    addDoctor,
    searchDoctor,
    stopStatus,
    getDoctor
}
//获取医生列表
function getDoctorList(pageNo,pageSize) {
    return axios({
        url: api.doctorApi.getDoctorList,
        headers:{
            "Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"
        },
        method: 'post',
        params: {
            pageNo,
            pageSize,
        }
    })
}
//添加医院
function addDoctor(addDoctorForm) {
    return axios({
        url: api.doctorApi.addDoctor,
        method: 'post',
        data: addDoctorForm
    })
}
//搜索医生
function searchDoctor(docName,hosName,status,sex,pageNo,pageSize){
    return axios({
        url: api.doctorApi.searchDoctor,
        method: 'post',
        params: {
            docName,hosName,status,sex,pageNo,pageSize
        }
    })
}
// 状态停用
function stopStatus(id){
        return axios({
            url:api.doctorApi.stopStatus,
            method:'post',
            params:{
                id
            }
        })
}
// 查看医生
function getDoctor(id,pageNo,pageSize){
    return axios({
        url:api.doctorApi.getDoctor,
        method:'post',
        params:{
            id,pageNo,pageSize
        }
    })
}